package com.mcptt.config.body.info;

import com.cloudptt.api.product.func.call.CallAttr;
import com.mcptt.config.body.info.mcptt.McpttInfoBody;

public abstract class InfoBody_NewCall extends McpttInfoBody {

	protected int callType = CallAttr.CallType_Prearranged;



	protected boolean isEmergency = false;
	protected String requestUri = "";
	protected String callingUserId = "";
	protected String callingGroupId = "";

	public InfoBody_NewCall()
	{}
	abstract public boolean isEmergency();
	abstract public boolean hasVideo();
	abstract public int getCallType();
	abstract public String getRequestUri();
	abstract public String getCallingUserId();
	abstract public String getCallingGroupId();

	public String getCalling()
	{
		if(callType == CallAttr.CallType_Chat
				|| callType == CallAttr.CallType_Prearranged)
		{
			return callingGroupId;
		}
		else {
			return callingUserId;
		}
	}
	public String toString()
	{
		StringBuffer strBuf = new StringBuffer();
		strBuf.append("callType = ").append(callType).append(",");
		strBuf.append("requestUri = ").append(requestUri).append(",");
		strBuf.append("hasVideo = ").append(hasVideo()).append(",");
		strBuf.append("Calling = ").append(getCalling()).append(".");

		return strBuf.toString();
	}
}
